#pragma once

#include "String.h"

namespace WH
{
    static CString Format(const CString& Format)
    {
        return Format;
    }

    //格式化字符串 
    //举例 WH::Format(U"{} + {} = {}", 1, 2, 3) //返回 U"1 + 2 = 3"
    template<typename FirstArgType,  typename... Args>
    static CString Format(const CString& Format,const FirstArgType & FirstArg, Args... LeftArgs)
    {
        CString Result;
        uint64_t Index = Format.Find(U"{}");
        if(Index != -1)
        {
            Result = Format.SubString(0, Index) + WH::ToString(FirstArg) + Format.SubString(Index + 2);
        }
        else
        {
            return Result;
        }

        return WH::Format(Result, LeftArgs...);
    }

}

